package com.baizhi.service.impl;

import com.baizhi.entity.Sale;
import com.baizhi.mapper.SaleMapper;
import com.baizhi.service.SaleService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhengg
 * @since 2021-02-07
 */
@Service
public class SaleServiceImpl extends ServiceImpl<SaleMapper, Sale> implements SaleService {
    @Override
    public PageInfo<Sale> selectByPage(int pageNo, int pageSize, String orderBy) {
        PageHelper.startPage(pageNo,pageSize);
        QueryWrapper<Sale> qw=new QueryWrapper<>();
        qw.orderByDesc(orderBy);
        return new PageInfo<Sale>(baseMapper.selectList(qw));
    }
}
